home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / fontconfig-config.postinst < prev    next >
Text File  |  2009-03-19  |  3KB  |  95 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. rm_conffile() {
  6.     PKGNAME="$1"
  7.     CONFFILE="$2"
  8.     if [ -e "$CONFFILE" ]; then
  9.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  10.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
  11.         if [ "$md5sum" != "$old_md5sum" ]; then
  12.             echo "Obsolete conffile $CONFFILE has been modified by you."
  13.             echo "Saving as $CONFFILE.dpkg-bak ..."
  14.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  15.         else
  16.             echo "Removing obsolete conffile $CONFFILE ..."
  17.             rm -f "$CONFFILE"
  18.         fi
  19.     fi
  20. }
  21.  
  22. # Remove old ucf stuff
  23. rm -rf /var/lib/fontconfig
  24.  
  25. CONFAVAIL=/etc/fonts/conf.avail
  26. CONFDIR=/etc/fonts/conf.d
  27.  
  28. # Add the defoma configuration
  29. defoma_link="30-defoma.conf"
  30. ln -sf /var/lib/defoma/fontconfig.d/fonts.conf $CONFDIR/$defoma_link
  31.  
  32. unhinted="10-unhinted.conf"
  33. autohint="10-autohint.conf"
  34.  
  35. # (asac): cleanup old conf.d links transition - remove ancient left-over confs
  36. if dpkg --compare-versions "$2" lt "2.6.0-1ubuntu11~"; then
  37.   lp332992_ancient_conf_leftover="autohint.conf no-bitmaps.conf no-sub-pixel.conf sub-pixel.conf unhinted.conf yes-bitmaps.conf"
  38.   for f in $lp332992_ancient_conf_leftover; do
  39.     if [ -h $CONFDIR/$f ]; then
  40.     rm $CONFDIR/$f
  41.     fi
  42.     if [ -e $CONFDIR/$f ]; then
  43.     rm_conffile fontconfig-config $CONFDIR/$f
  44.     fi
  45.   done
  46. fi
  47.  
  48. # (asac): drop debconf transition - remove old hinting confs
  49. if dpkg --compare-versions "$2" lt "2.6.0-1ubuntu12~"; then
  50.   if [ -h $CONFDIR/$unhinted ]; then
  51.     rm $CONFDIR/$unhinted
  52.   fi
  53.   if [ -h $CONFDIR/$autohint ]; then
  54.     rm $CONFDIR/$autohint
  55.   fi
  56. fi
  57.     
  58. subpixel="10-sub-pixel-rgb.conf"
  59. no_subpixel="10-no-sub-pixel.conf"
  60.  
  61. # (asac): drop debconf transition - remove old subpixel configs once
  62. if dpkg --compare-versions "$2" lt "2.6.0-1ubuntu12~"; then
  63.   if [ -h $CONFDIR/$subpixel ]; then
  64.     rm $CONFDIR/$subpixel
  65.   fi
  66.   if [ -h $CONFDIR/$no_subpixel ]; then
  67.     rm $CONFDIR/$no_subpixel
  68.   fi
  69. fi
  70.  
  71. yes_bitmaps="70-yes-bitmaps.conf"
  72. #no_bitmaps="70-no-bitmaps.conf"
  73.  
  74. # (asac): drop debconf transition - remove old bitmap confs
  75. if dpkg --compare-versions "$2" lt "2.6.0-1ubuntu12~"; then
  76.   if [ -h $CONFDIR/$yes_bitmaps ]; then
  77.     rm $CONFDIR/$yes_bitmaps
  78.   fi
  79.  
  80. #  if [ -h $CONFDIR/$no_bitmaps ]; then
  81. #    rm $CONFDIR/$no_bitmaps
  82. #  fi
  83. fi
  84.  
  85. # Create /usr/local/share/fonts
  86. LOCALDIR=/usr/local/share/fonts
  87. if [ ! -d $LOCALDIR ]; then
  88.   if mkdir $LOCALDIR 2>/dev/null ; then
  89.     chmod 2775 $LOCALDIR
  90.     chown root:staff $LOCALDIR
  91.   fi
  92. fi
  93.  
  94.  
  95.